<script src="/statics/lib/upload/jquery-1.10.1.min.js" type="text/javascript"></script>
<script src="/statics/lib/upload/jquery.jBox.src.js" type="text/javascript"></script>
<script src="/statics/lib/upload/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<link type="text/css" href="/statics/lib/upload/jbox.css" rel="stylesheet" />
<link rel="stylesheet" href="/statics/lib/upload/style-metro.css">

<style>
.yellow{
	margin-left:<?=($_GET['w']-110)/2?>px
}

*{	
	text-decoration:none
}
form input{
	width:0px;
	height:0px;
}
.btn_1{
	width:<?=$_GET['w']-1?>px;
	height:24px;
	z-index:101;
	display:inline;
	position:absolute;
	top:0px;
	left:0px;
	border:0px solid red
}
.main_div{
	position:absolute;
	left:0px;
	top:0px;
	z-index:101;
	background:rgba(107, 94, 94, 0.24);
	border:0px
}
</style>
<div>
<div class="main_div" style="width:<?=$_GET['w']-1?>px;height:<?=$_GET['h']-1?>px">
	<span class="btn_1" style="">
		<a href="javascript:;" class="btn yellow mini">
			<i class="icon-pencil"></i> 选择</a>
			&nbsp;
		<a href="javascript:;" id="upload" class="btn green mini">
			<i class="icon-plus"></i> 上传</a>
	</span>
</div>
<form class="iform" action="/statics/upload/upload_json.php" method="post" enctype="multipart/form-data">
	<input type="file" name="imgFile" id="fileval" value="" />
	<input type="hidden" name="h" value="<?=$_GET['h']?>" />
	<input type="hidden" name="w" value="<?=$_GET['w']?>" />
	<input type="hidden" name="itag" value="<?=$_GET['itag']?>" />
	<input type="hidden" name="hidimg" value="<?=$_GET['name']?>" />
</form>
<script>
$(function(){
	$('.btn_1').animate({top:<?=($_GET['h']-25)/2?>},1400);
	$('.yellow').click(function(){
		$('input[name=imgFile]').click();
		var act = setInterval(function(){
			if($('input[name="imgFile"]').val() != ''){
				window.clearInterval(act);
				$.jBox.tip('点击上传吧','success');
				setTimeout(function(){
					$.jBox.closeTip();
				},1000);
			}
		},500);
	});
	$('#upload').click(function(){
		if($('input[name="imgFile"]').val() == '')
		{
			$.jBox.tip('尚未选择图片','error');
			return false;
		}
		$('form.iform').submit();
	});
})
<?php if(isset($_GET['status']) && $_GET['status'] == 'succ'){?>
	var par_fun = $(window.parent.document).find('#<?=$_GET["uptag"]?>');
	par_fun.html('<img id="s_auto" width="<?=$_GET["w"]?>" height="<?=$_GET["h"]?>" src="http://img.ichuanghui.com<?=$_GET["file"]?>"/><input type="hidden" value="<?=$_GET["file"]?>" name="<?=$_GET["name"]?>"/>');
	$('#<?=$_GET["uptag"]?>').selfupload();
<?php }?>
</script>